package com.lktx.bbfactory.common;

/**
 * 枚举了一些常用API操作码
 */
public enum ResultCode implements IErrorCode {
    /**
     * 通用返回状态码，复用HTTP状态码
     */
    SUCCESS(200, "操作成功"),

    VALIDATE_FAILED(404, "参数检验失败"),

    UNAUTHORIZED(401, "token已经过期或不存在"),
    FORBIDDEN(403, "没有相关权限"),

    Token_(119, "token已过期"),

    Token_ISNULL(120, "已经被其他账户顶下"),


    FAILED(500, "操作失败");


    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
